

#include <p18f458.h>
#include <delays.h>

void main(void) {
    CANCON=10;
    CANSTAT=0;
    TXB1CON=2;
    TXB1SIDH=0;
    TXB1SIDL=8;
    TRISA=7;
    BRGCON1=0;
    BRGCON2=10;
    BRGCON3=0;
    if(PORTAbits.RA0==1)
    {
        TXB1D1=3;
    }
    if(PORTAbits.RA1==1)
    {
        TXB1D1=5;
    }
    if(PORTAbits.RA2==1)
    {
        TXB1D1=6;
    }
    return;
}